<template>
  <div>
    <div v-for="category in menuPermissions" :key="category.name" class="permission-category">
      <h4>{{ category.name }}</h4>
      <div class="permission-items">
        <el-checkbox v-for="item in category.items" :key="item.key" v-model="item.checked" :disabled="true">
          {{ item.label }}
        </el-checkbox>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const menuPermissions = ref([
  {
    name: '合同管理',
    items: [
      { key: 'contract', label: '合同管理', checked: true },
      { key: 'requirement', label: '需求管理', checked: true }
    ]
  },
  {
    name: '计划管理',
    items: [{ key: 'plan', label: '计划管理', checked: true }]
  },
  {
    name: '生产管理',
    items: [
      { key: 'scheduling', label: '排产管理', checked: true },
      { key: 'production', label: '生产加工单', checked: false }
    ]
  },
  {
    name: '库存管理',
    items: [
      { key: 'outbound', label: '出库管理', checked: false },
      { key: 'return', label: '退货管理', checked: false }
    ]
  },
  {
    name: '客户管理',
    items: [{ key: 'customer', label: '客户管理', checked: false }]
  },
  {
    name: '个人中心',
    items: [
      { key: 'personal', label: '个人中心', checked: true },
      { key: 'message', label: '消息中心', checked: true },
      { key: 'approval', label: '审批中心', checked: true }
    ]
  },
  {
    name: '后台管理',
    items: [
      { key: 'user', label: '用户管理', checked: false },
      { key: 'organization', label: '组织管理', checked: false },
      { key: 'role', label: '角色管理', checked: false },
      { key: 'approvalManage', label: '审批管理', checked: false },
      { key: 'material', label: '物料管理', checked: false },
      { key: 'parameter', label: '参数计算', checked: false }
    ]
  }
])
</script>

<style lang="scss" scoped>
.permission-category {
  margin-bottom: 30px;
}

.permission-category h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #303133;
  font-size: 16px;
  font-weight: 600;
}

.permission-items {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
</style>
